The present invention relates to a small computer system interface (SCSI) of a system or subsystem device, and more particularly to a control method and apparatus for a synchronous SCSI data transfer according to the synchronous option of SCSI Standard ANSI X3.131-1986.
The SCSI standard, ANSI X.3.131-1986, defines a standard interface that is used in small computers having SCSI buses, and the disclosure of ANSI X.3.131-1986 is hereby incorporated by reference. Each device having a SCSI interface may operate as a TARGET device, an INITIATOR device, or a unit not involved in the present transfer depending upon the system programming. While each device is typically either a TARGET or an INITIATOR within the system, the SCSI standard does permit a given device to be a TARGET during some operations and an INITIATOR during others. Thus, to be completely flexible, an interface should have the capability to be redefinable as a TARGET or an INITIATOR.
Additionally, the SCSI standard defines and describes an optional synchronous data transfer mode and an optional synchronous data transfer protocol. The synchronous data transfer mode and protocol provide for an increase of data transfer rates across the SCSI bus during a data phase operation. During each synchronous data transfer operation, the two devices which have elected to take part in the transfer use a previously negotiated pacing factor that is defined as a REQUEST/ACKNOWLEDGE (REQ/ACK) offset.
The synchronous data transfer protocol defines two operation modes: the TARGET to INITIATOR data transfer mode (TARGET mode), and the INITIATOR to TARGET data transfer mode (INITIATOR mode).
For a TARGET mode data transfer, the TARGET device transmits one byte of data across the SCSI bus for each REQUEST pulse (REQ) that it transmits. During TARGET mode, the TARGET device may continue to transmit REQs and data bytes onto the SCSI bus until the difference between the number of REQs transmitted and the number of ACKNOWLEDGE pulses (ACKs) received is less than or equal to the REQ/ACK offset previously negotiated. The REQ/ACK offset represents the maximum number of REQs and corresponding bytes which a TARGET device may send before any corresponding ACKs are received from the INITIATOR device. As long as the TARGET device does not transmit data more rapidly than the INITIATOR can process and/or store, the synchronous data transfer to the INITIATOR is successfully completed.
During INITIATOR mode, the INITIATOR receives one or more REQs from its TARGET and begins to transmit a word of data across the SCSI bus for each REQ received. The INITIATOR transmits an ACK with each byte it transmits onto the SCSI bus. In this type of synchronous data transfer, the INITIATOR device may continue to transmit ACKs and data bytes until the difference between the number of REQs received from the TARGET device and the number of ACKs transmitted from the INITIATOR is equal to zero. As long as the TARGET device does not request by REQs more data bytes than it can process and/or store, the synchronous data transfer to the TARGET is successfully completed.
A problem arises, however, when a SCSI device receiving synchronous data starts to receive and process a synchronous data word which exceeds its joint capability to dynamically process and output data and temporarily store any backlog. A common example of this problem is a SCSI controller for a mass storage device, such as a SCSI disk drive, interfacing to a slower system channel, such as a DMA channel. In such a case, the SCSI controller receives the data from the SCSI disk drive and retransmits the data onto the slower speed system channel. For such a device, the capacity of the FIFO memory serves as a buffer until the FIFO memory is filled. After the FIFO memory is filled, however, the synchronous data being transferred must be paused by inserting wait states in the synchronous data transmission to prevent the loss of data by an overflow condition.
It is an object of this invention to provide a method for preventing the overflow of a FIFO memory storing synchronous data received by a SCSI device.
It is another object of this invention to provide an apparatus for preventing the overflow of a FIFO memory for storing synchronous data received by a SCSI device.